// 用户相关接口类型定义
export interface LoginParams {
  username: string
  password: string
  captcha?: string
}

export interface LoginResponse {
  access_token: string
  refresh_token: string
  user_info: UserInfo
  expires_in: number
}

export interface UserInfo {
  id: number
  username: string
  name: string
  email: string
  avatar?: string
  role: string
  permissions: string[]
}

// 图表数据接口类型定义
export interface ChartDataParams {
  type: 'bar' | 'line' | 'pie'
  dateRange?: [string, string]
  category?: string
}

export interface ChartDataResponse {
  categories: string[]
  series: Array<{
    name: string
    data: number[]
    type?: string
  }>
  total: number
  growth_rate: number
}

// 通用响应接口
export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
  success: boolean
}

// 分页相关接口
export interface PaginationParams {
  page: number
  pageSize: number
  sortBy?: string
  sortOrder?: 'asc' | 'desc'
}

export interface PaginationResponse<T = any> {
  list: T[]
  total: number
  page: number
  pageSize: number
  totalPages: number
}

// 文件上传相关接口
export interface UploadResponse {
  url: string
  filename: string
  size: number
  type: string
}

// 设置相关接口
export interface UserSettings {
  theme: 'light' | 'dark'
  language: string
  notifications: boolean
  autoSave: boolean
}

// 仪表盘数据类型定义
export interface DashboardStats {
  total_sales: number
  total_orders: number
  total_users: number
  growth_rate: number
  recent_activities: Activity[]
}

export interface Activity {
  id: number
  type: 'order' | 'user' | 'system'
  title: string
  description: string
  timestamp: string
  status: 'success' | 'warning' | 'error' | 'info'
}

// 系统日志相关接口
export interface SystemLog {
  id: number
  level: string
  module: string
  message: string
  timestamp: string
  user_id?: number
}

// 实时数据接口
export interface RealTimeData {
  online_users: number
  system_load: number
  memory_usage: number
  cpu_usage: number
}